Skip to content

Conversation

@amartinhuertas
Copy link
Member

Do not merge yet.
Requires Gridap's PR 1117 to be released.
Related to issue #184

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for creating TrialFESpace with DistributedCellField objects as boundary/initial data. The key changes include:

  • Added two new TrialFESpace constructor overloads that accept DistributedCellField arguments
  • Added a new interpolate_dirichlet! method to handle DistributedCellField interpolation
  • Refactored test code to verify interpolation works with both Julia functions and DistributedCellField objects

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/FESpaces.jl Added new overloads for TrialFESpace and interpolate_dirichlet! to support DistributedCellField arguments
test/FESpacesTests.jl Refactored interpolation tests into a helper function and added tests for DistributedCellField interpolation
NEWS.md Documented the new feature in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +424 to +431
function FESpaces.TrialFESpace(cf::DistributedCellField,f::DistributedSingleFieldFESpace)
spaces = map(local_views(f),local_views(cf)) do s, field
TrialFESpace(s,field)
end
DistributedSingleFieldFESpace(spaces,f.gids,f.trian,f.vector_type,f.metadata)
end


Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The two TrialFESpace overloads at lines 417-422 and 424-429 have identical implementations. The second overload (where DistributedCellField is the first argument) simply calls the same underlying Gridap TrialFESpace(s,field) function. Consider consolidating these into a single implementation or adding a comment explaining why both argument orders are necessary.

Suggested change
function FESpaces.TrialFESpace(cf::DistributedCellField,f::DistributedSingleFieldFESpace)
spaces = map(local_views(f),local_views(cf)) do s, field
TrialFESpace(s,field)
end
DistributedSingleFieldFESpace(spaces,f.gids,f.trian,f.vector_type,f.metadata)
end

Copilot uses AI. Check for mistakes.
uh4 = FEFunction(U,free_values,dirichlet_values)
eh4 = u - uh4

= Measure(Ω,3)
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable is redefined inside _interpolation_tests at line 131, shadowing the outer defined at line 88. While this works, it's confusing and the outer at line 88 appears to be unused. Consider removing the outer definition or using a different variable name in the inner function.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@amartinhuertas amartinhuertas self-assigned this Dec 18, 2025
@amartinhuertas amartinhuertas marked this pull request as ready for review December 18, 2025 23:51
@amartinhuertas
Copy link
Member Author

amartinhuertas commented Dec 18, 2025

Requires Gridap's PR gridap/Gridap.jl#1177 to be released.

This PR was already merged and released in 0.19.6.

Thus this PR is ready to be merged once we confirm that all tests pass.

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (d7e2d44) to head (f0d75a3).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/FESpaces.jl 0.00% 12 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #185   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          15      15           
  Lines        3961    3973   +12     
======================================
- Misses       3961    3973   +12     
Flag Coverage Δ
mpi 0.00% <0.00%> (ø)
sequential 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amartinhuertas amartinhuertas merged commit adb85be into master Dec 19, 2025
8 checks passed
@JordiManyer JordiManyer deleted the create_trial_fe_space_out_of_distributed_cell_field branch December 19, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants